//
//  LxGridViewFlowLayout.h
//  LxGridView
//

#import <UIKit/UIKit.h>
#import "THFilterModel.h"

#define stringify __STRING

@interface LxGridView : UICollectionView

@property (nonatomic, assign) BOOL editing;

@end

@interface THImgCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) UIButton *addBtn;
@property (copy, nonatomic) void(^addBtnClickBlock)(void);
@end

static CGFloat const LxGridView_DELETE_RADIUS = 10;
static CGFloat const ICON_CORNER_RADIUS = 10;

@class LxGridViewCell;

@protocol LxGridViewCellDelegate <NSObject>

- (void)deleteButtonClickedInGridViewCell:(LxGridViewCell *)gridViewCell;

@end

@interface THEditImgCell : UICollectionViewCell

@property (nonatomic, assign) BOOL editing;

@property (weak, nonatomic) UIImageView *imageView;
@property (weak, nonatomic) UILabel *lable;
@property (weak, nonatomic) UIButton *deleBtn;

@property (strong, nonatomic) THTextureModel *model;

@property (copy, nonatomic) void(^deleBtnClickBlock)(UICollectionViewCell *cell);

- (UIView *)snapshotView;

@end


@interface LxGridViewFlowLayout : UICollectionViewFlowLayout

@property (nonatomic, assign) BOOL panGestureRecognizerEnable;

@end

@protocol LxGridViewDataSource <UICollectionViewDataSource>

@optional

- (void)collectionView:(UICollectionView *)collectionView
        itemAtIndexPath:(NSIndexPath *)sourceIndexPath
    willMoveToIndexPath:(NSIndexPath *)destinationIndexPath;
- (void)collectionView:(UICollectionView *)collectionView
       itemAtIndexPath:(NSIndexPath *)sourceIndexPath
    didMoveToIndexPath:(NSIndexPath *)destinationIndexPath;

- (BOOL)collectionView:(UICollectionView *)collectionView
    canMoveItemAtIndexPath:(NSIndexPath *)indexPath;
- (BOOL)collectionView:(UICollectionView *)collectionView
       itemAtIndexPath:(NSIndexPath *)sourceIndexPath
    canMoveToIndexPath:(NSIndexPath *)destinationIndexPath;

@end

@protocol LxGridViewDelegateFlowLayout <UICollectionViewDelegateFlowLayout>

@optional

- (void)collectionView:(UICollectionView *)collectionView
                              layout:(UICollectionViewLayout *)collectionViewLayout
    willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView
                             layout:(UICollectionViewLayout *)collectionViewLayout
    didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView
                            layout:(UICollectionViewLayout *)collectionViewLayout
    willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView
                           layout:(UICollectionViewLayout *)collectionViewLayout
    didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;

@end
